package p270jp.pxv.android.viewholder;

import android.content.Context;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.view.ViewGroup;
import p045be.C1060c;
import p270jp.pxv.android.R;
import p270jp.pxv.android.activity.IllustDetailSingleActivity;
import p270jp.pxv.android.legacy.model.PixivIllust;
import p270jp.pxv.android.model.PixivIllustSeriesDetail;
import p307l9.EdgeTreatment;
import p314lg.ViewHolderIllustSeriesDetailHeaderBinding;
import p521th.FlexibleItemAdapterSolidItem;
import p521th.SolidItemViewHolder;

/* renamed from: jp.pxv.android.viewholder.IllustSeriesDetailHeaderSolidItem */
/* loaded from: classes2.dex */
public class IllustSeriesDetailHeaderSolidItem extends FlexibleItemAdapterSolidItem {
    private PixivIllustSeriesDetail illustSeriesDetail;
    private PixivIllust illustSeriesFirstIllust;

    /* renamed from: jp.pxv.android.viewholder.IllustSeriesDetailHeaderSolidItem$IllustSeriesDetailHeaderViewHolder */
    /* loaded from: classes2.dex */
    public static class IllustSeriesDetailHeaderViewHolder extends SolidItemViewHolder {
        private ViewHolderIllustSeriesDetailHeaderBinding binding;
        private final PixivIllustSeriesDetail illustSeriesDetail;
        private PixivIllust illustSeriesFirstIllust;

        private IllustSeriesDetailHeaderViewHolder(ViewHolderIllustSeriesDetailHeaderBinding s6Var, PixivIllustSeriesDetail pixivIllustSeriesDetail, PixivIllust pixivIllust) {
            super(s6Var.f2666e);
            this.binding = s6Var;
            this.illustSeriesDetail = pixivIllustSeriesDetail;
            this.illustSeriesFirstIllust = pixivIllust;
        }

        public static IllustSeriesDetailHeaderViewHolder createViewHolder(ViewGroup viewGroup, PixivIllustSeriesDetail pixivIllustSeriesDetail, PixivIllust pixivIllust) {
            return new IllustSeriesDetailHeaderViewHolder((ViewHolderIllustSeriesDetailHeaderBinding) C1060c.m10358a(viewGroup, R.layout.view_holder_illust_series_detail_header, viewGroup, false), pixivIllustSeriesDetail, pixivIllust);
        }

        public /* synthetic */ void lambda$onBindViewHolder$0(View view) {
            Context context = this.itemView.getContext();
            context.startActivity(IllustDetailSingleActivity.m4818j1(context, this.illustSeriesFirstIllust.f19079id));
        }

        @Override // p521th.SolidItemViewHolder
        public void onBindViewHolder(int i) {
            this.binding.f22249s.setText(this.illustSeriesDetail.title);
            this.binding.f22250t.setText(String.valueOf(this.illustSeriesDetail.seriesWorkCount));
            this.binding.f22247q.setMovementMethod(LinkMovementMethod.getInstance());
            this.binding.f22247q.setText(this.illustSeriesDetail.caption);
            if (this.illustSeriesFirstIllust == null) {
                this.binding.f22248r.setVisibility(8);
                return;
            }
            this.binding.f22248r.setVisibility(0);
            this.binding.f22248r.setOnClickListener(new View$OnClickListenerC4406g(this, 0));
        }
    }

    public IllustSeriesDetailHeaderSolidItem(PixivIllustSeriesDetail pixivIllustSeriesDetail, PixivIllust pixivIllust) {
        EdgeTreatment.m3909i(pixivIllustSeriesDetail);
        this.illustSeriesDetail = pixivIllustSeriesDetail;
        this.illustSeriesFirstIllust = pixivIllust;
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public int getSpanSize() {
        return 2;
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public SolidItemViewHolder onCreateViewHolder(ViewGroup viewGroup) {
        return IllustSeriesDetailHeaderViewHolder.createViewHolder(viewGroup, this.illustSeriesDetail, this.illustSeriesFirstIllust);
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public boolean shouldBeInserted(int i, int i2, int i3, int i4) {
        return i2 == 0;
    }
}
